import moment from "moment"
import type {Moment} from 'moment'


export function formatTimeStr(date:Moment) {
  return date.locale('zh-cn').format("YYYY-MM-DD HH:mm:ss")
}

export function formatTimeStrToYearMonth(date: Moment) {
  return {
    year: date.locale('zh-cn').format("YYYY"),
    month: date.locale('zh-cn').format("M")
  }
}

export function formatCurrTime() {
  return moment().locale("zh-cn").format("YYYY-MM-DD HH:mm:ss")
}

export function formatStrTime(date:string,format: string) {
  return moment(date).locale('zh-cn').format(format)
}